Skip to content

.getBytes called without charset#2

Open
iarenaza wants to merge 9 commits intohenrygarner:masterfrom
biotz:pr-henrygarner-biscuit-#1
Open

.getBytes called without charset#2
iarenaza wants to merge 9 commits intohenrygarner:masterfrom
biotz:pr-henrygarner-biscuit-#1

Conversation

@iarenaza
Copy link
Copy Markdown

@iarenaza iarenaza commented Jun 4, 2019

From issue #1

> I had different CRC32 checksums returned for the same string on
> different machines, because .getBytes is called without specifying a
> character encoding. The default encoding will be used, which is
> unspecified.
>
> I believe you should be calling it with utf-8 specified.

Implement a protocol that allows us to call the CRC methods on both strings and raw byte arrays. When using strings, let the caller specify an optional parameter stating the string character encoding (using any of the standard Java character encoding names). If the optional parameter is not specified, "UTF-8" is used.

Also implement CRC64 checksum. This was the only missing checksum from digest-crc ruby gem, which is the inspiration for biscuit.

iarenaza added 9 commits June 3, 2019 16:04
From the original issue at henrygarner#1

> I had different CRC32 checksums returned for the same string on
> different machines, because .getBytes is called without specifying a
> character encoding. The default encoding will be used, which is
> unspecified.
>
> I believe you should be calling it with utf-8 specified.

Implement a protocol that allows us to call the CRC methods on both
strings and raw byte arrays. When using strings, let the caller
specify an optional parameter stating the string character
encoding (using any of the standard Java character encoding names). If
the optional parameter is not specified, "UTF-8" is used.
This is the only missing checksum from digest-crc[1] ruby gem, which is
the inspiration for biscuit.

[1] https://github.com/postmodern/digest-crc
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

Successfully merging this pull request may close these issues.

1 participant