catwell / cw-lua Goto Github PK
View Code? Open in Web Editor NEWCatwell's Lua playground
Catwell's Lua playground
Command line Far:>lua:local sha=require'sha256' print(sha.hex("abc"))
result: 0000000000000000000000000000000000000000000000000000000000000000
this result returned for any input data, sha256.test.lua don't work.
This variant SHA-256 https://github.com/Egor-Skriptunoff/pure_lua_SHA work ok, like other SHA-256 algorithms.
lua:local sha=require'sha2' print(sha.sha256("abc"))
result: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Is it possible to fix your sha256 code and make it as fast as possible for Far?
lmdb uses big endian ints on BE machines, so something should be done on that. If all goes right it should be just a >
or <
thing for unpack.
The module sha256.lua
doesn't work correctly on 32-bit LuaJIT.
-- This program prints 3 different lines when run on LuaJIT for x86
-- On some systems, the first line contains correct value of hash,
-- but the second line is never correct.
local sha256 = require"sha256".hex
print(sha256("abc"))
print(sha256("abc"))
print(sha256("abc"))
Tested on Windows and Linux, on LuaJIT 2.0 and 2.1
always OK on LuaJIT x64,
wrong results on LuaJIT x86.
Another implementation of SHA256 for LuaJIT + FFI (https://stackoverflow.com/a/19988581/6834680) has the same problem.
Is this a LuaJIT bug?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.