>Hello all.
>
>I need to run this javascript code in VFP
>
>function sha1_base64(txt) {
> var md = forge.md.sha1.create();
> md.update(txt);
> return new Buffer(md.digest().toHex(), 'hex').toString('base64');
>}
>
>I've been searching and found this code
>
>oSC = Createobject("Wscript.Shell")
>oSC.Run("Cscript.exe some_program.js")
>
>But I don't know how to send or receive parameters.
>
>Thank you for your help.
That function is calling a function from another object you clearly don't
have in scope ( forge .md.sha1.create() ) so wscript.shell won't be able to run it
unless you provide all the source.
Better just use vfpencryption.fll:
set library to vfpencryption71 additive
chash = hash(m.txt,1)
cHash64 = strconv(m.cHash,13)
Note:
vfpencryption71.fll needs msvcr71.dll & msvcp71.dll
you can download all three from :
https://www.mediafire.com/file/yovlql0px5p9etl/VfpEncryption71.rar/file( uploaded by a user of the spanish vfp forum )
@nfoxdev
github.com/nfoxdev