(src []byte)
| 194 | } |
| 195 | |
| 196 | func nbaseDigitsToInt64(src []byte) (accum int64, bytesRead, digitsRead int) { |
| 197 | digits := min(len(src)/2, 4) |
| 198 | |
| 199 | rp := 0 |
| 200 | |
| 201 | for i := range digits { |
| 202 | if i > 0 { |
| 203 | accum *= nbase |
| 204 | } |
| 205 | accum += int64(binary.BigEndian.Uint16(src[rp:])) |
| 206 | rp += 2 |
| 207 | } |
| 208 | |
| 209 | return accum, rp, digits |
| 210 | } |
| 211 | |
| 212 | // Scan implements the [database/sql.Scanner] interface. |
| 213 | func (n *Numeric) Scan(src any) error { |