MCPcopy Create free account
hub / github.com/XTXMarkets/ternfs / validName

Function validName

cpp/shard/ShardDB.cpp:98–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96static constexpr uint64_t TERNFS_PAGE_SIZE = 4096;
97
98static bool validName(const BincodeBytesRef& name) {
99 if (name.size() == 0) {
100 return false;
101 }
102 if (name == BincodeBytesRef(".") || name == BincodeBytesRef("..")) {
103 return false;
104 }
105 for (int i = 0; i < name.size(); i++) {
106 if (name.data()[i] == (uint8_t)'/' || name.data()[i] == 0) {
107 return false;
108 }
109 }
110 return true;
111}
112
113static int pickMtu(uint16_t mtu) {
114 if (mtu == 0) { mtu = DEFAULT_UDP_MTU; }

Calls 3

BincodeBytesRefClass · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected