Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Is cryptohash as high-level as it could be? #30

Closed
nh2 opened this issue Nov 5, 2014 · 2 comments
Closed

Is cryptohash as high-level as it could be? #30

nh2 opened this issue Nov 5, 2014 · 2 comments

Comments

@nh2
Copy link

nh2 commented Nov 5, 2014

We were just looking at toHex and wondering whether it's necessary to write such a low-level concatMap.

Couldn't bytestring provide an inlinable combinator with which this could be expressed in a completely memory-safe fashion?

@vincenthz Have you had tries in the past to do this?

@nh2 nh2 changed the title Is cryptohash as low-level as it could? Is cryptohash as high-level as it could be? Nov 5, 2014
@vincenthz
Copy link
Owner

a concatMap approach will have quite a different profile, in term of memory usage and cpu usage. Also note that this is the same approach taken in base16-bytestring for performance reasons.

@nh2
Copy link
Author

nh2 commented Nov 7, 2014

@vincenthz I'm not suggesting to literally use concatMap, I'm rather asking whether you think that bytestring could provide a concatMap-like function which allows you to write toHex in a safe way (i.e. only providing a Char -> ByteString or Char -> Storable something function) with the same performance characteristics.

@vincenthz vincenthz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants