mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Digest generation
This commit is contained in:
parent
ee2d93128c
commit
1bd4d9a7e6
5 changed files with 51 additions and 5 deletions
|
@ -210,6 +210,19 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
## SHARED
|
||||
|
||||
def name_in_wire_format
|
||||
res = ''
|
||||
parts = name.split('.')
|
||||
parts.each do |x|
|
||||
res += sprintf('%02X', x.length)
|
||||
res += x.each_byte.map { |b| sprintf('%02X', b) }.join
|
||||
end
|
||||
|
||||
res += '00'
|
||||
|
||||
res
|
||||
end
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue