MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / soundex16

Method soundex16

libraries/Soundex/Soundex.cpp:73–87  ·  view source on GitHub ↗

reference implementation

Source from the content-addressed store, hash-verified

71
72// reference implementation
73uint16_t Soundex::soundex16(const char * str)
74{
75 uint8_t tmp = _length;
76 _length = 5;
77 char *p = soundex(str);
78 _length = tmp;
79
80 uint16_t value = (p[0] - 'A');
81 for (uint8_t i = 1; i < 5; i++)
82 {
83 value *= 7;
84 value += (p[i] - '0');
85 }
86 return value;
87}
88
89
90// reference implementation

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64