Comments (3)
You're welcome!
Yes. To do it fast I used this online tool, so OPN
became 0x4F, 0x50, 0x4E
and \x17
is an escaped form of 0x17
(I don 't know in which convention).
If I may, I'm whiling to contribute an update to your repo and package so it can be easily consumed from npm. Right now, you are asking people to install typescript, which shouldn't be required since they may want to use it on JS as well.
Yes, you are right, including the compiled javascript tsc will not a dependency any more. You can make a PR when you want.
Best regards!
from crc-full.
Hello,
I just made some tries. I think you get a wrong result because you are passing "OPN\x17"
as string. If you pass the equivalent byte array of ascii characters, you will havethe same result of C/C++.
As in the readme:
import {CRC} from 'crc-full'
var crc = new CRC(16, "CRC16", 0x1021, 0x0000, 0x0000, false, false);
var res = crc .compute([0x4F, 0x50, 0x4E, 0x17]); // Array with ascii integer of "OPN\x17"
The result (number) is 43177
but if you convert to an hex string you will have: 'a8a9'
, that is the same result obtained in C.
h_string = res.toString(16)
Hope to been useful
Best regards
Giuseppe Riolo
from crc-full.
@RioloGiuseppe hello! Thank you very much for the quick response.
I got it working!
If I may, I'm whiling to contribute an update to your repo and package so it can be easily consumed from npm. Right now, you are asking people to install typescript, which shouldn't be required since they may want to use it on JS as well.
If you accept the PR and will update the npm package, I can push it later Today.
Thanks!
from crc-full.
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 crc-full.