Skip to content

Instantly share code, notes, and snippets.

@ashutosh1211
Created November 14, 2024 07:57
Show Gist options
  • Save ashutosh1211/a941bb0050e230f62cc2c263f4a3ddd2 to your computer and use it in GitHub Desktop.
Save ashutosh1211/a941bb0050e230f62cc2c263f4a3ddd2 to your computer and use it in GitHub Desktop.
AADHAR Biometric API wadh calulcation
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
lr = 'Y';
ra = "F"; //'F' for fingerprint
rc = 'Y';
de = 'N';
pfr = 'N';
text = '2.5' + ra + rc + lr + de + pfr;
var sha = CryptoJS.SHA256(text);
var base64 = CryptoJS.enc.Base64.stringify(sha);
console.log('wadh:', base64);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment