Error sha1 base64 whit node.js

i getting this error when use sha1 base64 whit node.js
any help about that.

Send the lolicode please otherwise no one can help you

`BLOCK:ConstantString
LABEL:NAME
value = $"<input.PASS>"
=> VAR @name
ENDBLOCK

BLOCK:Script
LABEL:SHA1_BASE64
INTERPRETER:NodeJS
INPUT name
BEGIN SCRIPT
var crypto = require('crypto');

var hash = crypto.createHash('sha1').update(name).digest('base64');

console.log(hash);
END SCRIPT
OUTPUT Int @hash
ENDBLOCK`

Change Int to String in the line that says OUTPUT Int @hash

1 Like

is this error OB ? or mine.

It’s your mistake. Js is returning a string but you’re trying to set it in OB2 as an int.

1 Like

yes i saw many thanks.

Hi Perce, long time …
why use Nodejs when you can do it with one line over OB2

string name = "123456";
string hash = ByteArrayToBase64String(data, Hash(data, System.Text.Encoding.UTF8.GetBytes(name), RuriLib.Functions.Crypto.HashFunction.SHA1).AsBytes(), false);
1 Like

thats why i like use node.js.only this.