Git Product home page Git Product logo

buffershift's People

Contributors

cjdelisle avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

s73obrien

buffershift's Issues

not shifting whole buffer

hi
buffershift only seems to shift 1 byte, but not the whole buffer:

Testcode:
`const BufferShift = require('buffershift');

rotate();

function rotate(){
var bufLen = 2;
var buf = new Buffer(bufLen);
buf[0] = 0x01;
for (var k = 0; k < bufLen * 8; k++){
console.log(k + '. Iteration with : ' + buf.toString('hex'));
BufferShift.shl(buf, 1);
}
}`

Result:
`0. Iteration with : 0100

  1. Iteration with : 0200
  2. Iteration with : 0400
  3. Iteration with : 0800
  4. Iteration with : 1000
  5. Iteration with : 2000
  6. Iteration with : 4000
  7. Iteration with : 8000
  8. Iteration with : 0000
  9. Iteration with : 0000
  10. Iteration with : 0000
  11. Iteration with : 0000
  12. Iteration with : 0000
  13. Iteration with : 0000
  14. Iteration with : 0000
  15. Iteration with : 0000
    But expecting:0. Iteration with : 0001
  16. Iteration with : 0002
  17. Iteration with : 0004
  18. Iteration with : 0008
  19. Iteration with : 0010
  20. Iteration with : 0020
  21. Iteration with : 0040
  22. Iteration with : 0080
  23. Iteration with : 0100
  24. Iteration with : 0200
  25. Iteration with : 0400
  26. Iteration with : 0800
  27. Iteration with : 1000
  28. Iteration with : 2000
  29. Iteration with : 4000
  30. Iteration with : 8000`

kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.