oxc_resolver 11.19.1

ESM / CJS module resolution
Documentation
use std::hash::Hasher;

/// Since the cache key is memoized, use an identity hasher
/// to avoid double cache.
#[derive(Default)]
pub struct IdentityHasher(u64);

impl Hasher for IdentityHasher {
    fn write(&mut self, _: &[u8]) {
        unreachable!("Invalid use of IdentityHasher")
    }

    fn write_u64(&mut self, n: u64) {
        self.0 = n;
    }

    fn finish(&self) -> u64 {
        self.0
    }
}