MCPcopy
hub / github.com/syncthing/syncthing / DeviceIDFromString

Function DeviceIDFromString

lib/protocol/deviceid.go:52–56  ·  view source on GitHub ↗

DeviceIDFromString parses a device ID from a string. The string is expected to be in the canonical format, with check digits.

(s string)

Source from the content-addressed store, hash-verified

50// DeviceIDFromString parses a device ID from a string. The string is expected
51// to be in the canonical format, with check digits.
52func DeviceIDFromString(s string) (DeviceID, error) {
53 var n DeviceID
54 err := n.UnmarshalText([]byte(s))
55 return n, err
56}
57
58// DeviceIDFromBytes converts a 32 byte slice to a DeviceID. A slice of the
59// wrong length results in an error.

Callers 15

initFunction · 0.92
TestAddDeviceFunction · 0.92
TestAddAndRemoveFunction · 0.92
initFunction · 0.92
processUpdateMethod · 0.92
TestPendingFolderFunction · 0.92
NewGlobalFunction · 0.92
eventLoopMethod · 0.92
deletePendingDevicesMethod · 0.92
getPendingFoldersMethod · 0.92
deletePendingFoldersMethod · 0.92
getDBCompletionMethod · 0.92

Calls 1

UnmarshalTextMethod · 0.95

Tested by 15

initFunction · 0.74
TestAddDeviceFunction · 0.74
TestAddAndRemoveFunction · 0.74
initFunction · 0.74
TestPendingFolderFunction · 0.74
initFunction · 0.74
initFunction · 0.74
TestSymlinksFunction · 0.74
TestFileTypeChangeFunction · 0.74