-
-
Notifications
You must be signed in to change notification settings - Fork 689
add UInt64 #10417
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
add UInt64 #10417
Conversation
std/haxe/UInt64.hx
Outdated
| @:from public static inline function ofInt(x:Int):UInt64 | ||
| return Int64.ofInt(x); | ||
|
|
||
| @:to private #if (!js || analyzer) inline #end function toFloat():Float { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's with the #if (!js || analyzer)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it at https://github.com/HaxeFoundation/haxe/blob/4.2.1/std/UInt.hx#L310 , Will remove toFloat though, because it's not in Int64 and I think it would have an imprecise output.
|
I'm struggling to figure out what happened to this request. Was it decided to not support 64-bit unsigned integers? Or is there another recommendation for working w/ that data type? |
|
Looks like the branch was deleted? |
|
Could be. I think today github has a more informative comment when a pull request is closed due to a deleted branch, but there might be some nuance here or maybe github added that more recently. Can this be reopened? Or should I start fresh with a new Issue and Pull Request mentioning this one, porting over the work that was already done here, and then we can go from there? |
|
Hello I am the creator, if I remember correctly I think I deleted it as I thought I would make another pull request later. I still have the code for UInt64 I just need to write the unit tests and then I could send in a pull request. Would that work? |
|
Sounds great! As long as you are fine doing that work (and if there wasn't any major reason why it couldn't be done). I will certainly use it whenever it becomes available. |
|
So... after digging into my my use case for requesting this, I might not need a 64-bit unsigned integer type after all. My end goal is to have a Also, it would have made more sense for me to review BouncyCastle's Java implementations since they would obviously not have the availability of using unsigned integer types. Still, I think it would be lovely to have the simulated Aside from that, I will at least submit a new Issue to track an enhancement request for adding a SHA-512 implementation, and possibly work on a pull request for the implementation/tests. |
|
@AndrewDRX About Sha512 implementation you can check this one : https://github.com/HaxeFoundation/crypto/blob/master/src/haxe/crypto/Sha512.hx |
|
Thanks! That is certainly what I was looking for regarding the hash implementations. And I'll check out your proposals and comment if I think of anything worth mentioning. |
UInt overflow system with Int64 functions such as toString/parseString. Underlying type of UInt64 is Int64, equivalent to UInt's underlying type being Int.