Skip to content

Commit

Permalink
[+] v0.1.4-pre
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMaka committed Sep 29, 2024
1 parent a130ffe commit 01c9719
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ See tests and examples for inspiration.

| [version history](misc/kawalas_log.md) |
|-------------------------------------------|
| => [v0.1.4](misc/kawalas_log.md#v014) |
| => [v0.1.3](misc/kawalas_log.md#v013) |
| => [v0.1.2](misc/kawalas_log.md#v012) |
| => [v0.1.1](misc/kawalas_log.md#v011) |
| => -------- |
| => [v0.1.1](misc/kawalas_log.md#v011) |
| <img width=100/> |

</td>
Expand Down
30 changes: 13 additions & 17 deletions misc/kawalas_log.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@

## Version logs

##### v0.1.1
- Initial commit
- - Porting over some of the python tools I wrote, as a single module
- - Data dump of initial working library { lib.rs, kwl32.rs, bai.rs }
##### v.1.4-pre
- Added `chunk32` and `chunks32` to kwl32

##### v0.1.3
- Added edge case handlers to `pad32l` and `pad32r`
- - Functions needed to be more robust as the ones accepting arbitrary length
- Tests added to cover most of bai and kwl32
- Modules are now public

##### v0.1.2
- Removed traits
- - Codebase wasn't written with enough respect for them, so they aren't being used

- Modified `View` method `summary()` (still too crude)
- - Now prints each k,v to a single line if less than `SUMMARY_COUNT`
- - Changed summary key _"Signature"_ to _"sig"_

- Fixed printing error in example `basic_stream`

- Added `data()` and `len()` wrappers to `Signature` and `Word` types for convenience
- Added more common `pop` to`View`, returns the hex `String` as opposed to `Word` type.
- Added more common `pop` to`View`, returns the hex `String` as opposed to `Word` type
- Swapped some magic numbers for constants

##### v0.1.3
- Added edge case handlers to `pad32l` and `pad32r`
- - Functions needed to be more robust as the ones accepting arbitrary length
- Tests added to cover most of bai and kwl32
- Modules are now public

##### v.1.4-pre
- Added `chunk32` and `chunks32` to kwl32
##### v0.1.1
- Initial commit
- - Porting over some of the python tools I wrote, as a single module
- - Data dump of initial working library { lib.rs, kwl32.rs, bai.rs }

3 changes: 1 addition & 2 deletions src/kwl32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pub mod util {
use std::cmp::{ min, max };

// outout the result of right padding input with zeros
// output the result of right padding input with zeros
pub fn pad32r(bytes: &[u8]) -> [u8;32] {
let ost = min(32, bytes.len() as i32) as usize;
let mut padded = [0u8;32]; padded[..ost] . copy_from_slice(&bytes[..ost]);
Expand Down Expand Up @@ -51,7 +51,6 @@ use std::cmp::{ min, max };
if bytes.len() < 32 { pad32r(bytes) }
else { let mut buf = [0u8;32]; buf . copy_from_slice(&bytes[..32]); buf }
}

// takes an arbitrary lengthed slice, returns an array of 32 byte slice(s)
pub fn chunks32(bytes: &[u8]) -> Vec<[u8;32]> {
(0..bytes.len()) . step_by(32) . map(|x| { chunk32(&bytes[x..]) })
Expand Down

0 comments on commit 01c9719

Please sign in to comment.