Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy function #14

Open
rmxhaha opened this issue Jul 15, 2015 · 0 comments
Open

copy function #14

rmxhaha opened this issue Jul 15, 2015 · 0 comments

Comments

@rmxhaha
Copy link

rmxhaha commented Jul 15, 2015

I think your copy function is one off.
if I try to copy

var buf = buffer.create(32);
buffer.copy( buffer.from( 'abcdefg' ), buf, 0, 0, 5 );
console.log( buffer.to( buffer.subarray( buf, 0, 5 ) ) );

it outputs 'abcde'
isn't it suppose to be 'abcdef' ?
because that's index 0 1 2 3 4 5

it's kinda strange that beginning ( index 0) is inclusive but last index (index 5) isn't

I kinda doubt this issue is gonna be resolved looking at last commit
I'll try to hack into the code and perhaps fork it somehow
:) I don't know how send fixes to repository that isn't mine just yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant