@@ -197,7 +197,7 @@ func (m Metadata) BuildTime() time.Time {
197197
198198type readerOptions struct {}
199199
200- // ReaderOption are options for [Open] and [FromBytes ].
200+ // ReaderOption are options for [Open] and [OpenBytes ].
201201//
202202// This was added to allow for future options, e.g., for caching, without
203203// causing a breaking API change.
@@ -241,12 +241,12 @@ func Open(file string, options ...ReaderOption) (*Reader, error) {
241241if err != nil {
242242return nil ,err
243243}
244- return FromBytes (data ,options ... )
244+ return OpenBytes (data ,options ... )
245245}
246246return nil ,err
247247}
248248
249- reader ,err := FromBytes (data ,options ... )
249+ reader ,err := OpenBytes (data ,options ... )
250250if err != nil {
251251_ = munmap (data )
252252return nil ,err
@@ -290,9 +290,9 @@ func (r *Reader) Close() error {
290290return err
291291}
292292
293- //FromBytes takes a byte slice corresponding to a MaxMind DB file and any
293+ //OpenBytes takes a byte slice corresponding to a MaxMind DB file and any
294294// options. It returns a Reader structure or an error.
295- func FromBytes (buffer []byte ,options ... ReaderOption ) (* Reader ,error ) {
295+ func OpenBytes (buffer []byte ,options ... ReaderOption ) (* Reader ,error ) {
296296opts := & readerOptions {}
297297for _ ,option := range options {
298298option (opts )
@@ -353,6 +353,14 @@ func FromBytes(buffer []byte, options ...ReaderOption) (*Reader, error) {
353353return reader ,nil
354354}
355355
356+ // FromBytes takes a byte slice corresponding to a MaxMind DB file and any
357+ // options. It returns a Reader structure or an error.
358+ //
359+ // Deprecated: Use OpenBytes instead. FromBytes will be removed in a future version.
360+ func FromBytes (buffer []byte ,options ... ReaderOption ) (* Reader ,error ) {
361+ return OpenBytes (buffer ,options ... )
362+ }
363+
356364// Lookup retrieves the database record for ip and returns a Result, which can
357365// be used to decode the data.
358366func (r * Reader )Lookup (ip netip.Addr )Result {