Skip to content

Commit

Permalink
Add jsdoc comment to Reader.reverseBuffer() to clarify how it works
Browse files Browse the repository at this point in the history
  • Loading branch information
pokusew committed Dec 28, 2018
1 parent fb8c4e2 commit 5a2109f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ class Reader extends EventEmitter {

pendingLoadAuthenticationKey = {};

// TODO: better way?
/**
* Reverses a copy of a given buffer
* Does NOT mutate the given buffer, returns a reversed COPY
* For mutating reverse use native .reverse() method on a buffer instance
* @param src {Buffer} a Buffer instance
* @returns {Buffer}
*/
static reverseBuffer(src) {

const buffer = Buffer.allocUnsafe(src.length);
Expand Down

0 comments on commit 5a2109f

Please sign in to comment.