open-index/open-npm huggingface dataset:
npm package: @saulx/hash
Description: Fast, low collision hashing based on djb2
Latest version: 3.0.0

# hash

Fast, low collision hashing based on djb2

## hash

Returns a 64 bit number, works for any data type

```javascript
import { hash } from '@saulx/hash'
hash({ x: true })
hash([1, 2, 3])
hash('xyz')
```

## hashObjectIgnoreKeyOrder

Returns a 64 bit number, works for objects and arrays - ignores order of keys in objects

```javascript
import { hashObjectIgnoreKeyOrder } from '@saulx/hash'
console.log(
  hashObjectIgnoreKeyOrder({ x: true, y: true }) ===
    hashObjectIgnoreKeyOrder({ y: true, x: true })
)
```

## hashCompact

Same as hash but returns a 62 bit string

```javascript
import { hashCompact } from '@saulx/hash'

console.log(hashCompact({ x: true, y: true }))
```