Open
Conversation
e625cdf to
e58e323
Compare
Collaborator
|
thanks for the PR, the build currently fails on linting |
Contributor
Author
|
Just pushed up a commit to fix the linting error |
jberkel
reviewed
Oct 25, 2021
| public var datatypeValue: Blob { | ||
| var bytes: [UInt8] = [] | ||
| withUnsafeBytes(of: self) { pointer in | ||
| // little endian by default on iOS/macOS, so reverse to get bigEndian |
Collaborator
There was a problem hiding this comment.
What about Linux? Will this work everywhere?
Contributor
Author
There was a problem hiding this comment.
ah you're right, this would likely fail on non-macOS. i'll look for the right way to get defined bit order regardless of system.
Collaborator
There was a problem hiding this comment.
the simplest way here would be
withUnsafeBytes(of: bigEndian) { pointer in
bytes.append(contentsOf: pointer)
}however, why is it stored as big endian by default? given that it implies a conversion in most cases.
jberkel
reviewed
Jul 17, 2022
| let lBytes: [UInt8] = lhs.bytes.reversed() | ||
| let rBytes: [UInt8] = rhs.bytes.reversed() | ||
|
|
||
| for byteIndex in stride(from: max(lhs.bytes.count, rhs.bytes.count) - 1, to: 0, by: -1) { |
Collaborator
There was a problem hiding this comment.
wouldn't it be easier to change the iteration from 0 to bytes.count to avoid having to do reversed in the first place?
headyann53-byte
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for
UInt32andUInt64. For the 64 bit versions, the 8 bytes are stored as aBLOBin big endian format. UInt32 are stored in a normalINTEGERcolumn