@spa-tools/utilities
hash()
The hash()
function simply hashes the provided value using the browser's sha256 crypto algorithm.
Usage
import { hash } from '@spa-tools/utilities';
const value = { baz: 123, foo: 'bar' };
const hashedValue = hash(value);
console.log(hashedValue);
// -> 'fdf216617c29ad5894de2528e51f783392a864c38ab4d0411a0ac59435621afd'
Arguments
Name | Type | Required? | Default | Description |
---|---|---|---|---|
value | unkown | yes | - | The value to hash |
Returns
string
- The hashed value.