npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bfchain/algorithm-stream-merger

v1.2.7

Published

> An Algorithm of Merge

Downloads

16

Readme

Algorithm Stream Merger

An Algorithm of Merge

片段合并算法:用来将碎片数据通过规则不断合并成更大的数据,并提供查询功能。

概念入门

定义了三个名词:

  1. Frame ,不可分割的单元数据
  2. Fragment 片段,由连续的帧组成
  3. Stream ,由不连续的片段拼接而成。是一个简单的片段管理器

这里最关键的概念是 Frame,也就是帧。 开发者可以自定义帧的概念是什么来实现片段的自动合并功能,这也是这个算法的核心目的:

  • 开发者需要定义:
    1. 如何对比两帧之间的顺序?
    2. 两帧是否是连续的?

补充说明

此外,还有一个方向的概念:ORDER,可以简单地理解成是“正序播放”还是“倒带播放”,本项目中:

  1. left被定义是小值,与min近义,但min只用在边界清晰的情况下的极值
  2. right被定义是大值,与max近义,但max只用在边界清晰的情况下的极值
  3. up被定义为to-right/from-left,也就是从小变大,UPUP!
  4. down被定义为to-left/from-right,也就是从大变小,DOWN~
  5. startend 的含义取决于 order
    1. orderup时,startleftendright
    2. orderdown时,startrightendleft
    3. left/right类似,我们使用first/last来代表边界清晰的情况下的极值

      每一个 Fragment 都有明确的 order。它的 firstFramelastFrame 由它的 order 决定 但它的 minmax 是固定的