Files
go-jdenticon/debug_hash.js
Kevin McIntyre f84b511895 init
2025-06-18 01:00:00 -04:00

16 lines
590 B
JavaScript

const jdenticon = require('./jdenticon-js/dist/jdenticon-node.js');
const crypto = require('crypto');
const testInputs = ['test-hash', 'example1@gmail.com'];
testInputs.forEach(input => {
// Generate hash using Node.js crypto (similar to what our Go code should do)
const nodeHash = crypto.createHash('sha1').update(input).digest('hex');
console.log(`Input: "${input}"`);
console.log(`Node.js SHA1: ${nodeHash}`);
// See what Jdenticon generates
const svg = jdenticon.toSvg(input, 64);
console.log(`SVG length: ${svg.length}`);
console.log('---');
});