Comments (3)
Looks like the seed
is a array
(list
in Python) object, and its members' type is Number
(int
in Python). So, the code may like this:
byte_array = list(bytes.fromhex("93 14 2C 08")) # both bytes and bytearray are OK
array = ctx1.call("calculateKey", byte_array)
from jsengine.
Why bytearrays? JavaScript has no this type, how does it work in JavaScript?
Here use string
(ctx.eval
) and supported types by json
(ctx.call
) to pass arguments to the backend engines.
from jsengine.
Why bytearrays? JavaScript has no this type, how does it work in JavaScript?
Here use
string
(ctx.eval
) and supported types byjson
(ctx.call
) to pass arguments to the backend engines.
Thank you for responce. Actually, I am not good in JS :)
Here is a part code of JS script:
function calculateKey(seed) {
if (seed.length < 4) {
throw "seed length must be at least 4";
}
var hiSeed = ((seed[0] << 8) + seed[1]) & 0xFFFFFFFF;
var loSeed = ((seed[2] << 8) + seed[3]) & 0xFFFFFFFF;
and I still cant understand how to pass my byte arrar to that function :(
from jsengine.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsengine.