-
Notifications
You must be signed in to change notification settings - Fork 34
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 shared validateHex
function
#70
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/earnifi/essential-eth/54Uwd9qHf76FeKz7NsbR9GLvSjMR |
Issue with |
…h into feature/validateHex
@@ -0,0 +1,13 @@ | |||
import { validateType } from './validate-type'; | |||
|
|||
export function validateHex(data: string | number): string { |
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.
Seems like a good idea, but this function is not used anywhere?
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.
Not quite yet, eventually I want to use it in hexZeroPad
and hexDataSlice
. I've had to write the same code in both functions to parse both strings and numbers, and then return a standard hex string prefixed with 0x
I thought it'd stay as a draft PR, think it got changed to just a regular one when I requested the review. Sorry!
Replaced by #76 |
Useful in keeping code DRY when solving #68 and #29
Potentially breaks https://github.com/Earnifi/essential-eth/blob/master/src/shared/tiny-big/tiny-big.ts, marking as draft while I investigate