Skip to content

Conversation

@X-oss-byte
Copy link

No description provided.

var hash = CryptoJS.MD5("Message");
SHA-1
The SHA hash functions were designed by the National Security Agency (NSA). SHA-1 is the most established of the existing SHA hash functions, and it's used in a variety of security applications and protocols. Though, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.
var hash = CryptoJS.SHA1("Message");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var hash = CryptoJS.SHA1("Message");
var hash = CryptoJS.SHA1("Message") // Parse and stringify a UTF-8 string
var words = CryptoJS.enc.Utf8.parse("Hello, World!");
var utf8 = CryptoJS.enc.Utf8.stringify(words);
// Parse and stringify a UTF-16 string
var words = CryptoJS.enc.Utf16.parse("Hello, World!");
var utf16 = CryptoJS.enc.Utf16.stringify(words);
// Parse and stringify a UTF-16LE string
var words = CryptoJS.enc.Utf16LE.parse("Hello, World!");
var utf16le = CryptoJS.enc.Utf16LE.stringify(words);
console.log("Encoded and decoded successfully. My favorite: Peacefully!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants