How to use the createSign function from crypto-js

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

187
188
189
190
191
192
193
194
195
196
if(type === "hmac") {
  hmac = cjshmac[method](input, key);
  base64str = crypto.enc.Base64.stringify(hmac)
}
else if(type == "sign") {
  base64str = crypto.createSign(method).update(input).sign(key, 'base64');
}
else {
  throw new Error('Algorithm type not recognized');
}
fork icon147
star icon6
watch icon2