Comments (6)
The rdata looks like this:
{dns_rrdata_sshfp,1,1,<<"8544BD5B4902151F80391563A6511FD864489763">>}
from dns_erlang.
The fingerprint goes on the wire as is so if you provide it in it's raw form (<<133,68,189,91,73,2,21,31,128,57,21,99,166,81,31,216,100,72,151,99>>
) you should get back the expected hex.
The documentation could be improved here but maybe the representation should be changed as well. What do you think?
from dns_erlang.
If I store the fingerprint in its bitstring format at reast, what is the proper way to covert it to a raw binary form?
from dns_erlang.
For my own use I'd vendor mochihex and adapt to_bin/1
to accept a binary (and handle bad input if need be). erlang:list_to_integer/2
in a comprehension or similar is also an option, eg: << <<(erlang:list_to_integer([C],16)):4>> || <<C>> <= HexBin >>.
from dns_erlang.
Turns out you have a hex_to_bin function in your library, so I've just cargo-culted that for now. :-)
FWIW, I think I may come back and revisit this in the future with a PR. The representation at rest should probably be a hex string as defined in http://tools.ietf.org/html/rfc4255#section-3.2 and thus the encoder should probably handle the conversion rather than pass it as is.
from dns_erlang.
Turns out you have a hex_to_bin function in your library, so I've just cargo-culted that for now. :-)
hah, I'm getting out of touch with my own code.
FWIW, I think I may come back and revisit this in the future with a PR. The representation at rest should probably be a hex string as defined in http://tools.ietf.org/html/rfc4255#section-3.2 and thus the encoder should probably handle the conversion rather than pass it as is.
I think the representation is an issue largely because there is no converters to and from master file format. Maybe adding the following would be the way to go:
dns:parse_rrdata/3
- takes class, type and a binary or string. Returns{ok, Term, Leftover}
or{error, Term}
.dns:rrdata_to_string/1
- takes an RR data record and callsdns:rrdata_to_string/3
dns:rrdata_to_string/3
- takes class, type and a binary or RR data record and returns a binary string.
from dns_erlang.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dns_erlang.