Skip to content

Commit f358db4

Browse files
committed
update examples
1 parent 76241b3 commit f358db4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/browser/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<script src="https://cdn.jsdelivr.net/gh/telkomdev/[email protected].0/dist/crypsi.min.js"></script>
4+
<script src="https://cdn.jsdelivr.net/gh/telkomdev/[email protected].1/dist/crypsi.min.js"></script>
55
</head>
66
<body>
77

@@ -16,7 +16,7 @@ <h2>Crypsi</h2>
1616
var publicKey = '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp3N/oEb01X0dNVVOeA5M\nrZ17lBHeRRYMCUZ6SRy+tivWtZZXnvbfTlSUpsakVVQznYF7dGSe90CbwLKD4uo0\nlIgIuTHEjWvi77ips7NRABUyp/Wb+f9gelGtCWI+Vr99MMWk28vAy35b3EeH7hMd\nj0JM/rdJgEJoUaWyHMcAbWvkPJM1oEC3aPXTve8iaF+4gnYIJNKYMsLV3VHl9ths\n4ysWUBHp/72Zesv+REBFWCUslngstucOgdUFYWc2m8Uj8U22fn6RLssrBH8uFrUa\nkTFGqlqJrF2nUs/114tTc8hW7FPjvVzeqXh5CIb8Rl5YTGh/Sx1dugQjlcKX5Uot\nMQIDAQAB\n-----END PUBLIC KEY-----\n';
1717

1818
// digest Hash with SHA512
19-
crypsi.digest.sha512DigestHex('wuriyanto').then(function(r) {
19+
crypsi.digest.sha512('wuriyanto').then(function(r) {
2020
console.log(r);
2121
});
2222

@@ -43,20 +43,20 @@ <h2>Crypsi</h2>
4343
});
4444

4545
// Digest
46-
crypsi.digest.sha512DigestHex('wuriyanto').then(function(res) {
46+
crypsi.digest.sha512('wuriyanto').then(function(res) {
4747
console.log(res);
4848
});
4949

50-
crypsi.digest.sha512DigestHex(new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])).then(function(res) {
50+
crypsi.digest.sha512(new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])).then(function(res) {
5151
console.log(res);
5252
});
5353

5454
// HMAC
55-
crypsi.hmac.sha512HmacHex(key256, 'wuriyanto').then(function(res) {
55+
crypsi.hmac.sha512(key256, 'wuriyanto').then(function(res) {
5656
console.log(res);
5757
});
5858

59-
crypsi.hmac.sha512HmacHex(key256, new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])).then(function(res) {
59+
crypsi.hmac.sha512(key256, new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])).then(function(res) {
6060
console.log(res);
6161
});
6262

examples/react/App.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ import {
5252
setDecryptedPassword(decoder.decode(decryptedPassword));
5353

5454
// Digest
55-
console.log(await digest.sha512DigestHex('wuriyanto'));
56-
console.log(await digest.sha512DigestHex(new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])));
55+
console.log(await digest.sha512('wuriyanto'));
56+
console.log(await digest.sha512(new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])));
5757

5858
// HMAC
59-
console.log(await hmac.sha512HmacHex(key256, 'wuriyanto'));
60-
console.log(await hmac.sha512HmacHex(key256, new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])));
59+
console.log(await hmac.sha512(key256, 'wuriyanto'));
60+
console.log(await hmac.sha512(key256, new Uint8Array([0x77, 0x75, 0x72, 0x69, 0x79, 0x61, 0x6E, 0x74, 0x6F])));
6161

6262
};
6363

0 commit comments

Comments
 (0)