encoding.go   A
last analyzed

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A gotil.HexDecode 0 2 1
A gotil.HexEncode 0 2 1
1
package gotil
2
3
import "github.com/gotilty/gotil/internal"
4
5
//HexDecode returns empty string with an error if the parameter is unsupported type.
6
//Just works with all primitive types
7
//If given parameter is different type instead of string, firstly, it will convert the given parameter to string with gotil.ToString().
8
func HexDecode(a interface{}) (string, error) {
9
	return internal.HexDecode(a)
10
}
11
12
//HexEncode returns empty string if the parameter is unsupported type.
13
//Just works with all primitive types.
14
//In decimal numbers, it should be used as a "string" in numbers where the total number of digits is too many.
15
func HexEncode(a interface{}) (string, error) {
16
	return internal.HexEncode(a)
17
18
}
19