Skip to content

Instantly share code, notes, and snippets.

@janthony
Last active March 1, 2017 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janthony/b1cde9747d48c27b8e1c92ef461a8123 to your computer and use it in GitHub Desktop.
Save janthony/b1cde9747d48c27b8e1c92ef461a8123 to your computer and use it in GitHub Desktop.
Crypto.js modular consumption example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello crypto</title>
<script src="scripts/require.js"></script>
<script type="text/javascript">
require.config({
packages: [
{
name: 'crypto-js',
location: 'scripts/crypto-js',
main: 'index'
}
]
});
require(["crypto-js/aes", "crypto-js/sha256"], function (AES, SHA256) {
console.log("rocks");
console.log(SHA256("Message"));
});
</script>
</head>
<body>
<p>Hello world</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment