Download wp-calypso/client/lib/analytics/utils/hash-pii.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 324 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/utils/hash-pii.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/analytics/utils/hash-pii.js
-
curl -L -o hash-pii.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/analytics/utils/hash-pii.js
324 Bytes
| import sha256 from 'hash.js/lib/hash/sha/256'; | |
| /** | |
| * Hashes users' Personally Identifiable Information using SHA256 | |
| * @param {string|number} data Data to be hashed | |
| * @returns {string} SHA256 in hex string format | |
| */ | |
| export default function hashPii( data ) { | |
| return sha256().update( data.toString() ).digest( 'hex' ); | |
| } | |