Bonnier news library for hashing user_ids.
const { createPersistentHashedId } = require('@bonniernews/persistent-hash');
or
import { createPersistentHashedId } from '@bonniernews/persistent-hash';
async function hashUserID(id) {
try {
const hashedId = await createPersistentHashedId(id);
return hashedId;
} catch (error) {
console.error('Error hashing the user ID:', error);
throw error;
}
}