How to use the SHA384 function from crypto-js

Find comprehensive JavaScript crypto-js.SHA384 code examples handpicked from public code repositorys.

120
121
122
123
124
125
126
127
128
129

SHA512: function(data, secret) {
  return CryptoJS.SHA512(secret + data);
},
SHA384: function(data, secret) {
  return CryptoJS.SHA384(secret + data);
},
SHA256: function(data, secret) {
  return CryptoJS.SHA256(secret + data);
},
fork icon0
star icon6
watch icon3

+ 9 other calls in file

65
66
67
68
69
70
71
72
73
74
},
sha256() {
  return CryptoJS.SHA256(this.text).toString();
},
sha384() {
  return CryptoJS.SHA384(this.text).toString();
},
sha512() {
  return CryptoJS.SHA512(this.text).toString();
},
fork icon0
star icon1
watch icon1

+ 17 other calls in file

6
7
8
9
10
11
12
13
14

    return array.toString(CryptoJS.enc.Hex);
}

public static sha384(message: string): string {
    const array: any = CryptoJS.SHA384(message);

    return array.toString(CryptoJS.enc.Hex);
}
fork icon11
star icon0
watch icon2

6
7
8
9
10
11
12
13
14

    return array.toString(CryptoJS.enc.Hex);
}

public static sha384(message: string): string {
    const array = CryptoJS.SHA384(message);

    return array.toString(CryptoJS.enc.Hex);
}
fork icon11
star icon0
watch icon2

32
33
34
35
36
37
38
39
40
41
function sha256(s) {
    return CryptoJS.SHA256(s).toString();
}

function sha384(s) {
    return CryptoJS.SHA384(s).toString();
}

function sha512(s) {
    return CryptoJS.SHA512(s).toString();
fork icon0
star icon0
watch icon1

1
2
3
4
5
6
7
8
9
10
// 引用 crypto-js 加密模块
var CryptoJS = require('crypto-js')

function SHA1Encrypt() {
    var text = "12312312"
    return CryptoJS.SHA384(text).toString();
}

console.log(SHA1Encrypt())
// faec670ce75fe79cae1fa899617818031b1f201c  40
fork icon0
star icon0
watch icon2